<?php

$id = isset($_REQUEST['id'])?$_REQUEST['id']:0;

$con = mysql_connect("localhost","root","");
mysql_set_charset('utf8',$con);
if(!$con){
	echo "Ket noi khong thanh cong";
}
mysql_select_db("for_woman",$con);

$query = "Select ma.id,ma.name,ma.material,ma.making,ma.note,ma.tham_khao 
			from forwoman_monan ma
			where (ma.id = $id or $id = 0)";

$result = mysql_query($query);
$arr=array();

while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
    $arr[] = $row;

}
$arr1['post'] = $arr;

header('Content-type: application/json; charset=utf-8');
//header("Content-type: png");
echo json_encode($arr1);

?>
